#include "AI_Actor.h"
#include "createCustomClasses.h"

//Remove this - for debug only, should print via Debug Class
#include <iostream>

AI_Actor::AI_Actor(CharacterTypes _characterType)
{
	character = CreateCustomClasses::createClass(_characterType);

}

ActionList* AI_Actor::updateBehaviour(float _deltaSeconds)
{
	ActionList* actions = NULL;


	actions = BehaviourArbitrator::update(&immediate, &shortTerm, &longTerm, &events, _deltaSeconds, character);

//	std::cout << "\nWorld Time: " << WorldData::getWorldTimeElapsed() << " Number of Behaviours: " << immediate.getNumberOfBehaviours();


	return actions;
}

void AI_Actor::eventTriggered(Event* _e)
{
	events.add(_e);

	/*
	NewBehaviour* newBehaviour = BehaviourArbitrator::eventTrigger(_e);

	if (newBehaviour != NULL)
	{
		if (newBehaviour->stack == Stacks::immediate)
			immediate.push(newBehaviour->behaviour);
		else if (newBehaviour->stack == Stacks::shortTerm)
			shortTerm.push(newBehaviour->behaviour);
		if (newBehaviour->stack == Stacks::longTerm)
			longTerm.push(newBehaviour->behaviour);
	}
	*/
}


AI_Actor::~AI_Actor()
{

}